package com.wang.action;

import com.wang.entity.TbBbsAttention;
import com.wang.response.ResultResponse;
import com.wang.service.TbBbsAttentionService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/bbs")
@Api(tags="关注")
public class BbsAttentionAction {
     @Autowired
     private TbBbsAttentionService tbbbsAttentionService;
    /*
    添加关注
     */
    @PostMapping("insertbbsattention")
   private ResultResponse insertbbsattention(@RequestBody TbBbsAttention tbbbsAttention){
       return this.tbbbsAttentionService.insertbbsattention(tbbbsAttention);
   }
    /*
    取消关注
     */
    @PostMapping("removebbsattention/{attentionId}")
   private ResultResponse removebbsattention(@PathVariable Integer attentionId){
       return this.tbbbsAttentionService.removebbsattention(attentionId);
    }
    /*
     查看关注
     */
    @PostMapping("findbbsattention/{userId}")
    @Operation(summary = "查看自己关注")
    private ResultResponse findbbsattention(@PathVariable Integer userId){
        return this.tbbbsAttentionService.findbbsattention(userId);
    }
    /*
查看关注所有
 */
    @PostMapping("findbbsattentionall")
    private ResultResponse findbbsattentionall(@RequestBody TbBbsAttention tbBbsAttention){
        return this.tbbbsAttentionService.findbbsattentionall(tbBbsAttention);
    }
}
